package com.grad.webstudy.enums;

/**
 * @Description:
 * @Author: zjf
 * @Date: 2020/2/5 20:56.
 */
public enum CourseLevelEnums {
    EASY(1,"入门级"),
    PRIMARY(2,"初级"),
    MIDDLE(3,"中级"),
    HIGH(4,"高级"),

    ;

    private int level;

    private String levelDesc;

    CourseLevelEnums(int level, String levelDesc) {
        this.level = level;
        this.levelDesc = levelDesc;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getLevelDesc() {
        return levelDesc;
    }

    public void setLevelDesc(String levelDesc) {
        this.levelDesc = levelDesc;
    }

    public static String getLevelDescByLevel(int level) {

        for (CourseLevelEnums courseLevelEnums : CourseLevelEnums.values()) {
            if (level == courseLevelEnums.getLevel()) {
                return courseLevelEnums.getLevelDesc();
            }
        }
        return null;
    }

}
